<div class="bjui-pageContent">
    <form action="{:U('save_role')}" data-callback="dialogFormCall" data-toggle="validate" data-alertmsg="false" class="dialogForm">
        <input type="hidden" name="id" value="{$va.id}"/>
        <div class="form-group">
            <label class="x100">角色名称:</label>
            <input type="text" name="name" data-rule="required" value="{$va.name}"/>
        </div>
        <div class="form-group">
            <label class="x100">角色描述:</label>
            <input type="text" name="remark" data-rule="required" value="{$va.remark}"/>
        </div>
        <p><b class="mr15">权限分配</b> <input type="checkbox" name="" data-toggle="icheck" class="roll_all" data-label="全选" /></p>
        <table class="table table-bordered table-striped role_right" >
            <tbody>
            <tr>
                <td><b class="mr15">内容管理</b> <input type="checkbox" name="" data-toggle="icheck" class="roll_lev_all" data-label="全选"  /></td>
            </tr>
            <tr>
                <td>
                    <ul class="group-list clearfix">
                        <li>
                            <input type="checkbox" name="" data-toggle="icheck" data-label="文章管理" />
                        </li>
                        <li>
                            <input type="checkbox" name="" data-toggle="icheck" data-label="文章分类" />
                        </li>
                        <li>
                            <input type="checkbox" name="" data-toggle="icheck" data-label="帮助管理" />
                        </li>
                    </ul>
                </td>
            </tr>
            <tr>
                <td><b class="mr15">内容管理</b> <input type="checkbox" name="" data-toggle="icheck" class="roll_lev_all" data-label="全选"  /></td>
            </tr>
            <tr>
                <td>
                    <ul class="group-list clearfix">
                        <li>
                            <input type="checkbox" name="" data-toggle="icheck" data-label="文章管理" />
                        </li>
                        <li>
                            <input type="checkbox" name="" data-toggle="icheck" data-label="文章分类" />
                        </li>
                        <li>
                            <input type="checkbox" name="" data-toggle="icheck" data-label="帮助管理" />
                        </li>
                    </ul>
                </td>
            </tr>
            </tbody>
        </table>
    </form>
</div>
<script>
    $(function () {
        $('.roll_all').on('ifChanged', function () {
            $('.role_right').find('input[type="checkbox"]').iCheck(this.checked ? 'check' : 'uncheck');
        });
        $('.roll_lev_all').on('ifChanged', function () {
            $(this).parents('tr').next('tr').find('input[type="checkbox"]').iCheck(this.checked ? 'check' : 'uncheck');
        });
    });
</script>
<include file="Common/footer" ftype="save" />